﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace FB.Data.Models
{
    public class TrackChangeLog
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ID { get; set; }


        [Required, DataType(DataType.DateTime)]
        public DateTime Date { get; set; }


        [StringLength(256)]
        [Required]
        public string Table { get; set; }

        
        [StringLength(256)]
        public string User { get; set; }


        [Required]
        [EnumDataType(typeof(DBAction))]
        public DBAction Action { get; set; }

        [Required]
        [StringLength(256)]
        public string ActionDesc { get; set; }

        [StringLength(800)]
        public string ObjectType { get; set; }

        [Column(TypeName="ntext")]
        public string SerializedData {get; set;}
    }


    public class TrackChangelogConfiguration : EntityTypeConfiguration<TrackChangeLog>
    {
        public TrackChangelogConfiguration()
        {
            
        }
    }

}
